﻿@using WebShop.Infrastructure;

@model WebShop.ViewModels.ShoppingCartViewModel

@{
    ViewBag.Title = "Details";
}

<h2>Details</h2>

<fieldset>
    <legend>Order</legend>

    <div class="display-label">OrderDate</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.Order.OrderDate)
    </div>

    <div class="display-label">RequiredDate</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.Order.RequiredDate)
    </div>

    <div class="display-label">ShippedDate</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.Order.ShippedDate)
    </div>

    <div class="display-label">Shippers</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.Order.Shippers.CompanyName)
    </div>

    <div class="display-label">Freight</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.Order.Freight)
    </div>

    <div class="display-label">ShipName</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.Order.ShipName)
    </div>

    <div class="display-label">ShipAddress</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.Order.ShipAddress)
    </div>

    <div class="display-label">ShipCity</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.Order.ShipCity)
    </div>

    <div class="display-label">ShipRegion</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.Order.ShipRegion)
    </div>

    <div class="display-label">ShipPostalCode</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.Order.ShipPostalCode)
    </div>

    <div class="display-label">ShipCountry</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.Order.ShipCountry)
    </div>
</fieldset>

@Html.Partial("~/Views/ProductsCart/_ProductsInOrder.cshtml", Model.ProductsInCart)

<p>
    @if (User.IsInRole(Constants.ROLE_ADMIN))
    {
        @Html.ActionLink("Edit", "Edit", new { id = Model.Order.OrderID }) @:|
        @Html.ActionLink("Delete", "Delete", new { id = Model.Order.OrderID }) @:|
    }
    @Html.ActionLink("Back to List", "Index")
</p>
